home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / DWSTK / FINDSB.BAS < prev    next >
BASIC Source File  |  1996-10-10  |  3KB  |  103 lines

  1. '******************************************************************************
  2. 'File:      findsb.bas
  3. 'Version:   2.22
  4. 'Tab stops: every 2 columns
  5. 'Project:   FINDSB utility
  6. 'Copyright: 1994-1995 DiamondWare, Ltd.  All rights reserved.
  7. 'Written:   Erik Lorenzen & Don Lemons
  8. 'Purpose:   Example code to autodetect and print out the sound hardware
  9. 'History:   94/10/21 KW Started findsb.c
  10. '           94/11/12 DL translated to BASIC
  11. '           95/02/02 EL Cleaned up & Finalized
  12. '           95/03/22 EL Finalized for 1.01
  13. '           95/04/11 EL Finalized for 1.02
  14. '           95/06/06 EL Finalized for 1.03, no changes
  15. '           95/06/06 EL Finalized for 2.00, no changes
  16. '           95/10/07 EL Finalized for 2.10, no changes
  17. '           95/10/18 EL Finalized for 2.20, no changes
  18. '           95/12/07 EL Finalized for 2.21, no changes
  19. '           96/10/10 EL Finalized for 2.22, no changes
  20. '******************************************************************************
  21.  
  22.  
  23.  
  24. '$INCLUDE: 'dws.bi'
  25. '$INCLUDE: 'err.bi'
  26.  
  27.  
  28.  
  29. 'DECLARE VARIABLES
  30.     COMMON SHARED dov     AS dwsDETECTOVERRIDES
  31.     COMMON SHARED dres    AS dwsDETECTRESULTS
  32.     COMMON SHARED ideal AS dwsIDEAL
  33.  
  34.  
  35.  
  36. 'START OF MAIN
  37.  
  38.     PRINT
  39.     PRINT "FINDSB 2.22 is Copyright 1994-95, DiamondWare, Ltd."
  40.     PRINT "All rights reserved."
  41.     PRINT : PRINT : PRINT
  42.  
  43.     'We need to set every field to -1 in dws_DETECTOVERRIDES struct; this
  44.     'tells the STK to autodetect everything.  Any other value
  45.     'overrides the autodetect routine, and will be accepted on
  46.     'faith, though the STK will verify it if possible.
  47.  
  48.     dov.baseport = -1
  49.     dov.digdma     = -1
  50.     dov.digirq     = -1
  51.  
  52.     IF dwsDetectHardWare(dov, dres) = 0 THEN
  53.         errDisplay
  54.     END IF
  55.  
  56.     'Test for FM or DIG
  57.     IF ((dres.capability AND dwscapabilityFM) OR ((dres.baseport <> 904) AND (dres.baseport <> -1))) THEN
  58.  
  59.         PRINT "Base port is ";HEX$(dres.baseport);" hex."
  60.         PRINT
  61.  
  62.         IF dres.mixtyp > 1 THEN
  63.             PRINT "The sound hardware supports mixing."
  64.             PRINT
  65.         ELSE
  66.             PRINT "Mixing will be done in software."
  67.             PRINT
  68.         ENDIF
  69.  
  70.         IF (dres.capability AND dwscapabilityFM) = dwscapabilityFM THEN
  71.             PRINT "The sound hardware supports FM music playback."
  72.             PRINT
  73.         ELSE
  74.             PRINT "Support for FM music playback not found."
  75.             PRINT
  76.         ENDIF
  77.  
  78.         IF (dres.capability AND dwscapabilityDIG) = dwscapabilityDIG THEN
  79.             'If we got here dws_DetectHardWare got PORT, IRQ, & DMA
  80.             PRINT "The sound hardware supports digitized sound playback."
  81.             PRINT "The sound hardware uses DMA channel";dres.digdma;"and IRQ level";dres.digirq;"."
  82.             PRINT
  83.         ELSEIF ((dres.baseport <> 904) AND (dres.baseport <> -1)) THEN
  84.             'If dres.baseport isn't either 388hex, or -1, then it's a valid
  85.             'baseport.  So if we got here, then we didn't find either IRQ
  86.             'level, and/or DMA channel.  In order to play digitized sounds,
  87.             'we need these settings as well.  In your application, you should
  88.             'ask the user.
  89.             PRINT "The sound hardware supports digitized sound playback,"
  90.             PRINT "but we couldn't find the DMA channel and/or IRQ level."
  91.             PRINT
  92.         ELSE
  93.             PRINT "Support for digitized playback not found."
  94.             PRINT
  95.         END IF
  96.  
  97.     ELSE
  98.         PRINT "No sound hardware detected."
  99.         PRINT
  100.     ENDIF
  101.  
  102. END
  103.